
#include "../mpmdComm.hpp"
#include "mpi.h"
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
using namespace EXTREAM;
int main(int argc, char **argv) {

  int my_rank, num_proc;
  MPI_Init(&argc, &argv);

  MpmdComm::getObjPtr()->init(MPI_COMM_WORLD);

  const int local_comm_size = MpmdComm::getObjPtr()->localCommSize();
  const int remote_comm_size = MpmdComm::getObjPtr()->remoteCommSize();
  const int local_rank = MpmdComm::getObjPtr()->rankInLocal();
  vector<int> send_data(remote_comm_size * 2, local_rank);

  vector<int> recv_data(remote_comm_size * 2);

  // 只发送不接收
  MPI_Alltoall(send_data.data(), 2, MPI_INT, nullptr, 0, MPI_INT,
               MpmdComm::getObjPtr()->interComm());

  MPI_Finalize();
  return 0;
}